import { post } from '../http'
import { cherryPick2Dict } from '@/utils/formatResponseData'

export const turnoverDict = () =>
  post({
    url: '/orderRecord/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        feebizTypeEnum: 'feebizTypeEnum',
        paymentWayEnum: 'paymentWayEnum',
        recordStatusEnum: 'recordStatusEnum',
        paymentWayTypeEnum: 'paymentWayTypeEnum',
        bizTypeEnum: 'bizTypeEnum',
        orderFeeNameEnum: 'orderFeeNameEnum',
        orderFeeNameEnumForCar: 'orderFeeNameEnumForCar',
        orderFeeNameEnumForCzsOrder: 'orderFeeNameEnumForCzsOrder',
        orderFeeNameEnumForShortOrder: 'orderFeeNameEnumForShortOrder',
        orderFeeNameEnumForCost: 'orderFeeNameEnumForCost',
        shortOrderChannelType: 'shortOrderChannelType',
        orderStatusEnum: 'orderStatusEnum',
      }),
  })

export const costConfirmDict = () =>
  post({
    url: '/orderFee/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        orderSourceEnum: 'orderSourceEnum',
        orderFeeTypeEnum: 'orderFeeTypeEnum',
        orderFeeStatusEnum: 'orderFeeStatusEnum',
        costTypeEnum: 'costTypeEnum',
        feeNameIdEnum: 'feeNameIdEnum',
        orderStatusEnum: 'orderStatusEnum',
      }),
  })

export const carAssetFeeDict = () =>
  post({
    url: '/carAssetFee/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        operationsCostFeeStatus: 'operationsCostFeeStatus',
        operationsCostFeeNameId: 'operationsCostFeeNameId',
        carAssetFeeTypeEnum: 'carAssetFeeTypeEnum',
        carAssetFeeEnum: 'carAssetFeeEnum',
        feeStatusEnum: 'feeStatusEnum',
        costTypeEnum: 'costTypeEnum',
        carPurchaseEnum: 'carPurchaseEnum',
        feeOperateStatusEnum: 'feeOperateStatusEnum',
      }),
  })
export const longCostConfirmDict = () =>
  post({
    url: '/czsOrderFee/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        orderSourceEnum: 'orderSourceEnum',
        orderFeeTypeEnum: 'orderFeeTypeEnum',
        orderFeeStatusEnum: 'orderFeeStatusEnum',
        costTypeEnum: 'costTypeEnum',
        feeNameIdEnum: 'feeNameIdEnum',
        orderStatusEnum: 'orderStatusEnum',
      }),
  })

// 三方支付账单
export const thirdPaymentBillDict = () =>
  post({
    url: '/thirdPaymentBill/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        bizTypeEnum: 'bizTypeEnum',
        payTypeEnum: 'payTypeEnum',
        payStatusEnum: 'payStatusEnum',
      }),
  })

// 聚合支付
export const polymerDict = () =>
  post({
    url: '/polymer/enumData',
    format: (res) =>
      cherryPick2Dict(res.result, {
        epType: 'epType',
        accountType: 'accountType',
        settleWay: 'settleWay',
      }),
  })

// 短租对账
export const shortOrderBillDict = () =>
  post({
    url: '/shortOrderBill/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        orderFeeTypeEnum: 'orderFeeTypeEnum',
        orderFeeStatusEnum: 'orderFeeStatusEnum',
        costTypeEnum: 'costTypeEnum',
        orderStatusEnum: 'orderStatusEnum',
        feeBillStatusEnum: 'feeBillStatusEnum',
        itemCategoryTypeEnum: 'itemCategoryTypeEnum',
      }),
  })
